{extend name='admin@main'}

{block name="button"}
{if auth("admin/banner/add")}
<button data-open='{:url("add")}' data-title="添加图片" class='layui-btn layui-btn-sm layui-btn-primary'>添加图片</button>
{/if}
{if auth("admin/banner/remove")}
<button data-action='{:url("remove")}' data-rule="id#{key}" class='layui-btn layui-btn-sm layui-btn-primary'>删除图片</button>
<button data-open='{:url("shua")}'  class='layui-btn layui-btn-sm layui-btn-primary'>刷新图片</button>

{/if}
{/block}

<style>
.nowrap{ white-space:pre-wrap !important;	}
</style>

{block name="content"}
<div class="think-box-shadow">
    {include file='banner/index_search'}
    <table class="layui-table margin-top-10" lay-skin="line">
        {notempty name='list'}
        <thead>
        <tr>
            <th class='list-table-check-td think-checkbox'>
                <input data-auto-none data-check-target='.list-check-box' type='checkbox'>
            </th>
            <th class='list-table-sort-td'>
                <button type="button" data-reload class="layui-btn layui-btn-xs">刷 新</button>
            </th>
            <th class='text-left nowrap' width="10%">图片LOGO</th>
            <th class='text-left nowrap' width="250px">图片名称</th>
            <th class='text-left nowrap' width="250px">图片分类</th>

            <th class='text-left nowrap' width="10%">图片状态</th>

            <th class='text-left nowrap' width="20%">操作</th>
        </tr>
        </thead>
        {/notempty}
        <tbody>
        {foreach $list as $key=>$vo}
        <tr data-dbclick>
            <td class='list-table-check-td think-checkbox'><input class="list-check-box" value='{$vo.id}' type='checkbox'></td>
            <td class='list-table-sort-td'><input data-action-blur="{:request()->url()}" data-value="id#{$vo.id};action#sort;sort#{value}" data-loading="false" value="{$vo.sort}" class="list-sort-input"></td>
            <td class='text-left nowrap'>
                {notempty name='vo.logo'}
                <img data-tips-image style="width:60px;height:60px" src="{$vo.logo|default=''}" class="margin-right-5 text-top">
                {/notempty}


            </td>

<!--            <td class='text-left nowrap'><span style="line-height: 60px">{$vo.id|default='--'}</span></td>
-->            
            <td class='text-left ' style="width:250px">{$vo.title|default='--'}<br />{$vo.create_at|default='--'}</td>
            <td class='text-left ' style="width:250px">{$vo.cate_name}</td>


            <td class='text-left nowrap'>
                状态：{eq name='vo.status' value='0'}<span class="layui-badge">已下线</span>{else}<span class="layui-badge layui-bg-green">在线中</span>{/eq}<br>
            </td>

            <td class='text-left nowrap'>

                <div class="nowrap margin-bottom-5">
                    {if auth("admin/banner/edit")}
                    <a data-dbclick class="layui-btn layui-btn-sm" data-open='{:url("edit")}?id={$vo.id}'>编 辑</a>
                    {else}
                    <a data-tips-text="您没有编辑图片的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">编 辑</a>
                    {/if}

                    {if isset($vo.status) and $vo.status eq 1}
                    <!--{if auth("admin/banner/forbid")}-->
                    <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('forbid')}" data-value="id#{$vo.id};status#0">禁 用</a>
                    <!--{else}-->
                    <a data-tips-text="您没有禁用图片的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">禁 用</a>
                    <!--{/if}-->
                    {else}
                    <!--{if auth("admin/banner/resume")}-->
                    <a class="layui-btn layui-btn-sm layui-btn-warm" data-action="{:url('resume')}" data-value="id#{$vo.id};status#1">启 用</a>
                    <!--{else}-->
                    <a data-tips-text="您没有启用图片的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">启 用</a>
                    <!--{/if}-->
                    {/if}




                    {if auth("admin/banner/remove")}
                    <a class="layui-btn layui-btn-sm layui-btn-danger" data-confirm="确定要删除数据吗?" data-action="{:url('remove')}" data-value="id#{$vo.id}">删 除</a>
                    {else}
                    <a data-tips-text="您没有删除图片的权限哦！" class="layui-btn layui-btn-sm layui-btn-primary layui-disabled">删 除</a>
                    {/if}

                </div>

            </td>
        </tr>
        {/foreach}
        </tbody>
    </table>

    {empty name='list'}<span class="notdata">没有记录哦</span>{else}{$pagehtml|raw|default=''}{/empty}

</div>
{/block}
